import type { BaseEntity, ID, IDS, PageQuery, PageResult } from '#/api/common';

import { requestClient } from '#/api/request';

export interface SysPost extends BaseEntity {
  postId: ID;
  postName: string;
  postCode: string;
  postSort: number;
  status: string;
}

const baseUrl = '/ur_biz/sys_post';

/** 查询岗位列表 */
export function listPost(params: PageQuery) {
  return requestClient.get<PageResult<SysPost>>(`${baseUrl}/list`, { params });
}

/** 岗位详情 */
export function getPost(id: ID) {
  return requestClient.get(`${baseUrl}/${id}`);
}

/** 新增岗位 */
export function addPost(data: SysPost) {
  return requestClient.post(`${baseUrl}/add`, data);
}

/** 修改岗位 */
export function editPost(data: SysPost) {
  return requestClient.post(`${baseUrl}/edit`, data);
}

/** 删除岗位 */
export function delPost(postIds: IDS) {
  return requestClient.post(`${baseUrl}/remove`, postIds);
}
